const BASEURL = '/index/recommend';
const recommendPathRule = [
  {
    cn: '个性推荐',
    name: 'gexingtuijian',
    path: `${BASEURL}/gexingtuijian`,
  },
  {
    cn: '歌单',
    name: 'gedan',
    path: `${BASEURL}/gedan`,
  },
  {
    cn: '主播电台',
    name: 'zhubodiantai',
    path: `${BASEURL}/zhubodiantai`,
  },
  {
    cn: '排行榜',
    name: 'paihangbang',
    path: `${BASEURL}/paihangbang`,
  },
];

/**
 *
 * @param nameStr 传入要跳转的模块的中文名字或者英文名
 * @returns 返回对应的组件路径
 */
export function indexTabsJump(nameStr: string): string {
  let path = 'index/recommend/gexingtuijian'; //默认
  recommendPathRule.map((item) => {
    if (item.cn === nameStr || item.name === nameStr) {
      path = item.path;
    }
  });
  return path;
}
